import math
from io import BytesIO
from typing import List
from seaman.core import JsonUtil
import pandas as pd
from common.client import client
from common.model import BaseData

# 定义测试数据集
bucketName = 'well'
objectName = '附件1-井XXX.xlsx'

# 获取测试基础数据
def get_test_base_data()-> List[BaseData]:
    file_data = client.get_object(bucketName, objectName)
    df = pd.read_excel(BytesIO(file_data.read()))
    data_list: List[BaseData] = []
    for index, row in df.iterrows():
        item: BaseData = BaseData()
        item.depth = row['depth']
        item.inclination = row['inclination']
        item.azimuth = row['azimuth']
        if index.__eq__(0):
            item.north = 0.0
            item.east = 0.0
            item.true_vertical_depth = item.depth
        data_list.append(item)
    return data_list